home *** CD-ROM | disk | FTP | other *** search
- Path: news.internex.net.au!usenet
- From: sultan@connexus.apana.org.au (Jon Hornstein)
- Newsgroups: comp.lang.c
- Subject: Re: malloc question
- Date: Mon, 08 Apr 1996 08:16:28 GMT
- Organization: connexus.apana.org.au
- Message-ID: <4k8mf0$39c@preeda.internex.net.au>
- References: <4k6tgn$13c8@pulp.ucs.ualberta.ca>
- NNTP-Posting-Host: dialin-30.internex.net.au
- X-Newsreader: Forte Free Agent 1.0.82
-
- malloc expects a numeric size_t as a parameter indicating how large a
- chunk of memory to allocate.
- I hope frames, whatever it is refers to a variable that contains a
- value that at least represents the number of bytes you require which I
- suppose in this case is sizeof(unsigned long int) * 100.
-
- Catch yer
-
- Jon
-
-
- hcolquho@gpu3.srv.ualberta.ca (Harry Colquhoun) wrote:
-
- >Not quite sure what's happening here, most likely something real stupid I
- >did, I'm sure.
-
- >compiled using djgpp under MSDOS->works fine
- >compiled using djgpp on SGI->core dump
-
- >-------------------------
- >global variable 'frames'
-
- >the problem:
-
- >unsigned long int *mem;
- >mem = (unsigned long int *) malloc (frames);
- >-------------------------
-
- >changing to 'unsigned long int mem[100]' and no malloc fixes problem
-
-
- >Anyone know why?
-
- >Harry.
- >(email me please)
-
- >--
- >------------------------------------------------------------------------------
- >DEEP THOUGHTS: "If trees could scream, would you still cut them down?...
- > Well, you would if they screamed all the time."
- >------------------------------------------------------------------------------
-
-
-